package com.luyi.sensor;

import com.luyi.sensor.websocket.controller.WebSocketServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @version: v1.0
 * @description：聊天模块的主启动类
 * @author: zhangconglong on 2021/11/26 19:33
 */
@MapperScan(basePackages = {"com.luyi.sensor.dao"})
//@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
@SpringBootApplication
public class SensorApplication {

    public static void main(String[] args) {
        SpringApplication.run(SensorApplication.class, args);
//        try {
//            SpringApplication.run(SensorApplication.class, args);
//        }catch(Exception e) {
//            e.printStackTrace();
//        }
//        //解决WebSocket不能注入的问题
//        SpringApplication springApplication = new SpringApplication(SensorApplication.class);
//        ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
//        WebSocketServer.setApplicationContext(configurableApplicationContext);
    }

}
